
#ifndef __mem_alloc__
#define __mem_alloc__

#include "mem_block_alloc.h"
#include "multi_malloc.h"
#include "common.h"

/*******************************************************************************
* @brief   TX POOL.
*******************************************************************************/
void os_mem_pool_creat(void);

#if (DBG_EN + MALLOC_DBG_EN) > 1
void *os_malloc(uint32_t size, char *file, int line);
void *os_calloc(uint32_t items, uint32_t size, char *file, int line);
void os_free(void *pdat, char *file, int line);

#define mem_malloc(size) os_malloc(size, __FILE__, __LINE__)
#define mem_calloc(items, size) os_calloc(items, size, __FILE__, __LINE__)
#define mem_free(pdat) os_free(pdat, __FILE__, __LINE__)

#else

void *os_malloc(uint32_t size);
void *os_calloc(uint32_t items, uint32_t size);
void os_free(void *pdat);

#define mem_malloc os_malloc
#define mem_calloc os_calloc
#define mem_free os_free
#endif

/*******************************************************************************
* @brief   mem malloc other.
*******************************************************************************/
extern const multi_malloc_type mem_sram;
extern const multi_malloc_type mem_ccm;
extern const multi_malloc_type mem_dram;


/*******************************************************************************
* @brief   mem block alloc.
*******************************************************************************/
extern mem_block_ext_cfg_type blk_sram;
void mem_blk_info(mem_block_ext_cfg_type *ecfg);

#endif // __mem_alloc__
